package com.liuzhilong.infrastructure.test.unittest.service;

import lombok.Data;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;

import java.util.Objects;

/**
 * 简单的测试服务,这个服务会依赖于另一个服务
* @author longandai@163.com
 */
@Data
@Accessors(chain = true)
public class SimpleService {
    private Simple2Service simple2Service;

    /**
     * 简单的逻辑
     * @param key
     */
    public String doLogic(String key ){
        if(Objects.equals(key,"key")){
            return "special";
        }
        return simple2Service.doService(key);
    }




    public static final SimpleService create(Simple2Service simple2Service) {
        return new SimpleService().setSimple2Service(simple2Service);
    }
}
